package com.demo.controller;

// 用户B获取公共Bean对象

import com.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class BeanScopesControllerB {
    // Bean对象注入(公共Bean对象）:属性注入
    @Autowired
    private User userY;

    // 获取userZ
    public User getUserY() {
        User user = userY;
        System.out.println("用户B获取公共Bean对象：");
        return user;
    }
}
